package com.bite.demo.proxy;

// 中介
// 静态代理 明显这个是比较麻烦的 每次房东需要添加新功能的时候就要再写一遍 比较麻烦
public class HouseProxy implements House{

    private HouseSubject houseSubject;

    public HouseProxy(HouseSubject houseSubject) {
        this.houseSubject = houseSubject;
    }

    @Override
    public void rent() {
        System.out.println("提供代理");
        houseSubject.rent();
        System.out.println("结束代理");
    }

    @Override
    public void sale() {
        System.out.println("提供代理");
        houseSubject.sale();
        System.out.println("结束代理");
    }
}
